﻿using UnityEngine;
using System.Collections;

public class msg : MonoBehaviour {

	public string message = "Write message here";
	public float length = 1f;
	public Vector3 move = new Vector3(0,1,0);
	Vector2 pos=Vector2.zero;
	
	

	// Use this for initialization
	void Start () {
	
	}
	
	// Update is called once per frame
	void Update () {
	
		length -= Time.deltaTime;
		
		transform.position+=move*Time.deltaTime;
		pos = Camera.main.WorldToScreenPoint(transform.position);
		
		if(length <= 0f)
			Destroy (gameObject);
	
	}
	
	void OnGUI()
	{
		
		
		GUI.Label(new Rect(pos.x,Screen.height-pos.y,500,500),message);
	
	}
}
